﻿
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Admin
{
    public partial class Oper_Form : Form
    {
        int ori_x,ori_y;

        public Oper_Form()
        {
            InitializeComponent();
        }

        private void Oper_Form_Shown(object sender, EventArgs e)
        {
            login();
        }

        private void login()
        {
            this.Visible = false; ;
            Login frm_login = new Login();
            if (frm_login.ShowDialog() == DialogResult.OK)
            {
                this.Visible = true;
                label1.Text = "欢迎：" + log_info.admin.admin_uname;
            }
            else
                this.Close();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            entitiy_form ef = new entitiy_form();
            ef.ShowDialog();
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            login();
        }

        private void Button_MouseDown(object sender, MouseEventArgs e)
        {
            PictureBox pic_box = (PictureBox)sender;
            PictureBox pic_box_1 = (PictureBox)this.Controls.Find(pic_box.Name+"_1", false)[0];
            ori_x = pic_box.Left;
            ori_y = pic_box.Top;
            pic_box.Top = pic_box_1.Top;
            pic_box.Left = pic_box_1.Left;
        }

        private void Auto_assign_Click(object sender, EventArgs e)
        {
            Assign assign_form = new Assign();
            assign_form.ShowDialog();
        }

        private void Adjust_Click(object sender, EventArgs e)
        {
            Manual_adjust manul_Adjust = new Manual_adjust();
            manul_Adjust.ShowDialog();
        }

        private void Stu_data_Click(object sender, EventArgs e)
        {
            StudentData studentData = new StudentData();
            studentData.ShowDialog();
        }

        private void Teacher_data_Click(object sender, EventArgs e)
        {
            TeacherData teacherData = new TeacherData();
            teacherData.ShowDialog();
        }

        private void Setting_Click(object sender, EventArgs e)
        {
            config frm_config = new config();
            frm_config.ShowDialog();
        }

        private void Admin_Data_Click(object sender, EventArgs e)
        {
            AdminData adminData = new AdminData();
            adminData.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Prepare_data prepare_Data = new Prepare_data();
            prepare_Data.ShowDialog();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            entitiy_form entitiy_Form = new entitiy_form();
            entitiy_Form.ShowDialog();
        }

        private void View_Result_Click(object sender, EventArgs e)
        {
            View_Result view_Result = new View_Result();
            view_Result.ShowDialog();
        }

        private void Button_MouseUp(object sender, MouseEventArgs e)
        {
            PictureBox pic_box = (PictureBox)sender;
            pic_box.Top = ori_y;
            pic_box.Left = ori_x;
        }
    }
}
